import { uiStyleProperties } from './common'

// slider
export const sliderProperties = [
    ...uiStyleProperties.filter(e => ['ui.style.width'].indexOf(e.model) !== -1),
    {
        model: 'ui.min',
        widget: 'inputNumber',
        label: '最小值',
        ui: {
            placeholder: '请输入最小值',
            controlsPosition: 'right',
            style: {
                width: '100%'
            }
        }
    },
    {
        model: 'ui.max',
        widget: 'inputNumber',
        label: '最大值',
        ui: {
            placeholder: '请输入最大值',
            controlsPosition: 'right',
            style: {
                width: '100%'
            }
        }
    },
    {
        model: 'ui.step',
        widget: 'inputNumber',
        label: '步长',
        ui: {
            placeholder: '请输入步长',
            controlsPosition: 'right',
            style: {
                width: '100%'
            }
        }
    },
    {
        model: 'ui.showStops',
        widget: 'switch',
        label: '显示断点'
    },
    {
        model: 'ui.showTooltip',
        widget: 'switch',
        label: '显示提示'
    },
    {
        model: 'ui.range',
        widget: 'switch',
        label: '是否为范围选择'
    },
    {
        model: 'ui.vertical',
        widget: 'switch',
        label: '竖向模式'
    },
    {
        model: 'ui.height',
        widget: 'input',
        label: '高',
        ui: {
            placeholder: '请填写单位(如: 100px)'
        },
        if (model) {
            return model && model.ui && model.ui.vertical
        }
    },
    {
        model: 'ui.showInput',
        widget: 'switch',
        label: '显示输入框'
    },
    {
        model: 'ui.showInputControls',
        widget: 'switch',
        label: '输入框控制按钮',
        if (model) {
            return model && model.ui && model.ui.showInput
        }
    },
    {
        model: 'ui.inputSize',
        widget: 'radioButton',
        label: '输入大小',
        enum: [
            { label: '小', value: 'mini' },
            { label: '中', value: 'small' },
            { label: '大', value: 'medium' }
        ],
        if (model) {
            return model && model.ui && model.ui.showInput
        }
    }
]
